This invention relates to a method and apparatus for controlling an electric discharge machine and, more particularly, to a method and apparatus for controlling an electric discharge machine of the type in which an electrode of a prescribed shape, held close to the surface of a workpiece, is moved into the workpiece to perform cutting and an electric discharge is produced between the electrode and the workpiece, thereby to machine the workpiece into the same shape as the electrode.
Electric discharge machines include: (1) a wire-cut electric discharge machine wherein a wire electrode is moved relative to a workpiece along a commanded path, thereby to perform electric discharge machining; and (2) an electric discharge machine wherein an electrode of a prescribed shape, held close to the surface of a workpiece, is moved into the workpiece to perform cutting and an electric discharge is produced between the electrode and the workpiece, thereby to machine the workpiece into the same shape as the electrode.
FIG. 1 is a view of the latter type electric discharge machine. An electrode EP serving as a punch is supported by a spindle SP, and is fed for machining (i.e., advanced) in the direction of the arrow by a servomotor, not shown. A voltage is applied by a power source PS across the electrode EP and a workpiece WK, which is to be machined into a die. Accordingly, when the electrode EP is advanced while a minute gap is maintained between the workpiece WK and the electrode EP, the workpiece WK is machined into a shape similar to that of the electrode EP. An enlarged bore of desired size can be readily machined in the workpiece WK by controlling, e.g., the machining pulses and the energy. If necessary, the machining operation is carried out while the electrode EP is being moved in an eccentric fashion, whereby an enlarged bore of any desired dimensions can be machined.
In the electric discharge machine of the above type, it is necessary to retract the electrode immediately upon the generation of a short-circuit signal which is produced when the electrode EP contacts the workpiece WK. However, with the conventional servomotor control method, it is not possible to retract the electrode EP immediately, even though the direction of electrode movement is changed by the generation of the short-circuit signal. FIG. 2 is a view of a conventional servomotor control system and is useful in explaining this point.
Referring to FIG. 2, numeral 101 denotes a paper tape in which numerical control (NC) data is punched. Numeral 102 denotes a control unit which causes a tape recorder (not shown) to read in the NC command data from the paper tape 101, and which decodes the read NC data, delivering, e.g., M, S and T function commands to the machine side through a heavy current switchboard and a move command Z.sub.c to a pulse distributor 103, which is the succeeding stage. The pulse distributor 103 executes well-known pulse distribution computations on the basis of the move command Z.sub.c, and generates distributed pulses P.sub.s at a frequency corresponding to a commanded speed. Numeral 104 designates a known accelerator/decelerator circuit which generates a train of pulses P.sub.i by rectilinearly accelerating the pulse rate of the train of distributed pulses P.sub.s at the occurrence of the pulse train P.sub.s and by rectilinearly decelerating the same at the end thereof. Numeral 105 indicates a D.C. motor by which the electrode EP is fed for machining. A pulse coder 106 generates one feedback pulse FP each time the DC motor 105 rotates by a predetermined amount. An error calculating and storing unit 107 is constructed of, for example, a reversible counter, and stores the difference E.sub.r between the number of the input pulses P.sub.i received from the accelerator/decelerator circuit 104 and that of the feedback pulses FP. This error calculating and storing unit 107 may be constructed, as shown in the figure, of an arithmetic circuit 107a for calculating the difference E.sub.r between the numbers of the pulses P.sub.i and FP, and an error register 107b for storing the error E.sub.r. More specifically, assuming that the DC motor 105 is rotating in the forward direction because of a command to that effect, the error calculating and storing unit 107 operates in such a manner that each time the input pulse P.sub.i is generated, it countes up by means of the arithmetic circuit 107a, while each time the feedback pulse FP is generated, it counts down, and the difference E.sub.r between the number of input pulses and the feedback pulses is stored in the error register 107b. Numeral 108 denotes a digital-to-analog converter for generating an analog voltage proportional to the content (digital value) of the error register 107b, and numeral 109 is a speed control circuit. The digital-to-analog (D/A) converter 108 and speed control circuit 109 comprise a motor drive circuit.
When the control unit 102 produces the move command Z.sub.c, the pulse distributor 103 executes the pulse distribution computation and provides the distributed pulses P.sub.s. Upon receiving the pulses P.sub.s, the accelerator/decelerator circuit 104 accelerates and decelerates the pulse rate thereof and applies the train of command pulses P.sub.i to the error calculating and storing circuit 107. Thus, the content of the error register 107b becomes non-zero, so that the digital-to-analog converter 108 provides a voltage and the motor 105 is driven by the speed control circuit 109 so as to move the electrode EP. When the motor 105 has rotated by a predetermined amount, the feedback pulse FP is generated by the pulse coder 106 and is applied to the error calculating and storing unit 107. Thenceforth, the electrode EP is servo-controlled with the difference E.sub.r maintained at a constant value in a steady state until it is fed for machining to a desired, or target, position.
When the electrode EP is being fed for machining and comes into contact with the workpiece, a short-circuit signal SS is generated. When this occurs, a retraction control section within the control unit 102 sends the pulse distributor 103 a command for retracting the electrode EP. The pulse distributor 103 responds to the retraction command by generating retraction, or "back-up", pulses BS that cause the content of error register 107b to become zero after a predetermined time. From then on the electode EP is retracted or backed up by the retraction pulses to separate from the workpiece.
It will be appreciated from the foregoing description of the the conventional method of FIG. 2 that, despite the generation of the short-circuit signal SS, the electrode EP will not back up unless the pulse number left in the error register 107b (which remaining pulse number is the result of the distributed pulses for forward movement) is stepped down to zero. In other words, retraction of the electrode EP does not start until the content of error register 107b becomes zero, which occurs after the passage of a predetermined length of time. Moreover, despite the generation of the short-circuit signal SS, the content of the error register 107b is not stepped down to zero until the lapse of said predetermined length of time, so that the electrode EP continues to advance until the content of the error register 107b becomes zero. This delays the retraction of the electrode and the resumption of machining, and thereby prolongs machining time.